import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import {
  showToast,
  showSuccess,
  showError,
	showFault
} from './utils/app'
import config from './config.js'
import util from '@/utils/utils.js'
import combination from '@/utils/combination.js'

// 分享jsddk
// #ifdef MP-WEIXIN || MP-QQ
import share from './common/share.js'
Vue.mixin(share)
// #endif
import shared from './common/wechate.js'
Vue.prototype.$wechat = shared
import wxLogin from './utils/wxLogin.js'
Vue.prototype.$Wxlogin = wxLogin
Vue.prototype.$combination = combination.enterIntoservier
Vue.prototype.$fxLink = util
Vue.prototype.$toast = showToast
// 完成弹窗
Vue.prototype.$success = showSuccess
Vue.prototype.$error = showError
Vue.prototype.$wxapp_id = config.wxapp_id
Vue.prototype.$name = config.name
Vue.prototype.$downApp = config.downApp
Vue.config.productionTip = false
Vue.prototype.$onLaunched = new Promise(resolve => {
  Vue.prototype.$isResolve = resolve
})

App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif